import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import javax.swing.JButton;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/

public class cargarGuide extends javax.swing.JFrame {
	//protected static final String String = null;
	private JButton cargar;
	private JLabel jLabel1;
	private JFormattedTextField valor;
	private Gestor tempges = new Gestor();
		
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				cargarGuide inst = new cargarGuide();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public cargarGuide() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
		setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			{
				jLabel1 = new JLabel();
				getContentPane().add(jLabel1);
				jLabel1.setText("Digite El Valor A Cargar");
				jLabel1.setBounds(124, 40, 144, 16);
			}
			{
				cargar = new JButton();
				getContentPane().add(cargar);
				cargar.setText("cargar");
				cargar.setBounds(149, 139, 72, 23);
				cargar.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						try {
							cargarMouseClicked(evt);
						} catch (FileNotFoundException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						} catch (IOException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						} catch (ClassNotFoundException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
				});
			}
			{
				valor = new JFormattedTextField();
				getContentPane().add(valor);
				valor.setBounds(124, 85, 130, 23);
			}
			pack();
			setSize(400, 300);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void cargarMouseClicked(MouseEvent evt) throws FileNotFoundException, IOException, ClassNotFoundException {
		System.out.println("cargar.mouseClicked, event="+evt);
		tempges.cargarTarjeta(Integer.parseInt(valor.getText()));				
	}
	

	
	

}
